package com.sskj.gcc.presenter;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gcc.ui.fragment.AssetFragment;
import com.sskj.gocoin.MyAppLication;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.AseetListBean;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.lib.http.JsonCallBack;

public class AssetFragmentPresenter extends BasePresenter<AssetFragment> {
    public void requestUserAssetList(boolean isFirst) {
        OkGo.<HttpData<AseetListBean>>get(HttpConfig.BASE_URL + HttpConfig.ASEET_LIST)
                .params("mobile", MyAppLication.getMobile())
                .execute(new JsonCallBack<HttpData<AseetListBean>>(this, isFirst) {
                    @Override
                    public void onSuccess(Response<HttpData<AseetListBean>> response) {
                        HttpData<AseetListBean> httpListData = response.body();
                        if (httpListData.getCode() == 200) {
                            mView.onDataSuccess(httpListData.getData());
                        }
                    }
                });
    }
}
